.\" libxbee - a C library to aid the use of Digi's XBee wireless modules
.\"           running in API mode.
.\" 
.\" Copyright (C) 2009 onwards  Attie Grande (attie@attie.co.uk)
.\" 
.\" libxbee is free software: you can redistribute it and/or modify it
.\" under the terms of the GNU Lesser General Public License as published by
.\" the Free Software Foundation, either version 3 of the License, or
.\" (at your option) any later version.
.\" 
.\" libxbee is distributed in the hope that it will be useful,
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
.\" GNU Lesser General Public License for more details.
.\" 
.\" You should have received a copy of the GNU Lesser General Public License
.\" along with this program. If not, see <http://www.gnu.org/licenses/>.
.TH XBEE_CONSETTINGS 3  04-Mar-2012 "GNU" "Linux Programmer's Manual"
.SH NAME
xbee_conSettings
.SH SYNOPSIS
.B #include <xbee.h>
.sp
.BI "xbee_err xbee_conSettings(struct xbee_con *" con ", struct xbee_conSettings *" newSettings ", struct xbee_conSettings *" oldSettings ");"
.sp
.nf
struct xbee_conSettings {
	/* libxbee options: */
	unsigned char noBlock;
	unsigned char catchAll;
	unsigned char noWaitForAck;
	
	/* generic options: */
	unsigned char queueChanges; /* for AT connections */
	unsigned char disableAck;   /* specific options for XBee 1 / causes use of FrameID 0x00 for others */
	unsigned char broadcast;
	
	/* XBee 2 / ZNet options: */
	unsigned char multicast;
	
	/* XBee ZigBee options: */
	unsigned char disableRetries;
	unsigned char enableEncryption;
	unsigned char extendTimeout;
	
	/* XBee 5 options: */
	unsigned char noRoute;

	/* other */
	unsigned char broadcastRadius;
};
.fi
.SH DESCRIPTION
.BR xbee_conSettings ()
allows you to configure the connection's parameters.
.sp
One of
.IR newSettings " and " oldSettings
can optionally be
.BR NULL ,
one must be non-NULL.
.sp
If they are non-NULL, then the struct pointed to by
.I oldSettings
will be filled with the effective settings before the call to
.BR xbee_conSettings (),
and then
.I newSettings
will be used to update the connection's settings.
.SS Return Value
On success this function will return XBEE_ENONE, otherwise an error number from
.IR "enum xbee_errors" " (as specified in " <xbee.h> )
.SH EXAMPLE
.in +4n
.nf
#include <xbee.h>

struct xbee *xbee;
struct xbee_con *con;
struct xbee_conSettings settings;

/* initialize xbee, using xbee_setup() */

/* initialize con, using xbee_conNew() */

if (xbee_conSettings(con, NULL, &settings) != XBEE_ENONE) return;
settings.disableAck = 1;
if (xbee_conSettings(con, &settings, NULL) != XBEE_ENONE) return;
.fi
.in
.SH AUTHOR
Attie Grande <attie@attie.co.uk> 
.SH "SEE ALSO"
.BR libxbee (3),
.BR xbee_setup (3),
.BR xbee_conNew (3)
